package com.rio.core;

import android.view.View;
import android.view.View.OnClickListener;

/**
 * 
 * 
 * @author rio.lv
 *
 */
public abstract class BaseOnClickListener<T> implements OnClickListener {

	private T item;
	
	private int position;

	public BaseOnClickListener(T t,int position) {
		this.item = t;
		this.position = position;
	}
	
	public BaseOnClickListener(T t) {
		this(t,0);
	}
	
	public BaseOnClickListener(int position) {
		this(null,position);
	}
	
	public BaseOnClickListener(int position,T t) {
		this(t,position);
	}
	
	
	@Override
	public void onClick(View view) {
		onClick(view,view.getId(),position,item);
	}
	
	public abstract void onClick(View view ,int id,int position,T item);

}
